<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            background-color: black;
            width: 300px;
            height: 400px;
            /* 背景色半透明,盒子里面的内容不受影响 */
            background: rgba(0, 0, 0, .2);
        }
    </style>
</head>

<body>
    <div></div>
</body>

</html>